package mt;
import main.U;


public class YoudaoMT extends C2EMT {

	public static String label ="Youdao";
	
	@Override
	public String translate(String query) throws Exception {
		query=U.preprocessStrForHttptransmition(query);
		//url example: http://fanyi.youdao.com/translate
		String res = U.getHTMLSrc("http://fanyi.youdao.com/translate?doctype=text&type=ZH_CN2EN&i="+query,"utf-8");
		String t ="result=";
		return segment(  res.substring(res.indexOf(t)+t.length(),res.length()));
	}

	public static void main(String[] args) throws Exception {
		
		System.out.println(new YoudaoMT().translate("真牛逼啊.是吧。"));
	}
}
